package com.pth.admin.action;

import com.opensymphony.xwork2.ActionSupport;
import com.pth.model.Zhinan;
import com.pth.service.ZhinanService;
import com.pth.utils.timeUtil;

@SuppressWarnings("serial")
public class ZhinanAllAction extends ActionSupport {

	
	private int id;
	
	private ZhinanService zhinanService;
	
	private Zhinan zhinan;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public ZhinanService getZhinanService() {
		return zhinanService;
	}

	public void setZhinanService(ZhinanService zhinanService) {
		this.zhinanService = zhinanService;
	}

	public Zhinan getZhinan() {
		return zhinan;
	}

	public void setZhinan(Zhinan zhinan) {
		this.zhinan = zhinan;
	}
	
	
	public String delete() throws Exception{
		
		Zhinan zn=zhinanService.getZhinanByid(id);
		zhinanService.delete(zn);
		return "delete";
	}
	
	public String modify() throws Exception{
		
		zhinan.setPublishtime(timeUtil.getCurrentDate());
		zhinanService.modify(zhinan);
		return "modify";
	}
	
}
